package com.wffz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wffz.mapper.CollectMoneyMapper;
import com.wffz.po.CollectMoney;
import com.wffz.service.CollectMoneyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author sunlei
 * @className CollectMoneyServiceImpl
 * @Description
 * @date 2023-02-28 10:50
 **/
@Service
@Slf4j
public class CollectMoneyServiceImpl implements CollectMoneyService {

    @Resource
    private CollectMoneyMapper moneyMapper;

    @Override
    public boolean saveCollectMoney(CollectMoney collectMoney) {
        return false;
    }

    @Override
    public CollectMoney getCollectMoneyDefault() {
        QueryWrapper<CollectMoney> wrapper = new QueryWrapper<>();
        wrapper.eq("status", "1");
        List<CollectMoney> list = moneyMapper.selectList(wrapper);
        if (list != null && list.size() > 0) {
            return list.get(0);
        } else {
            return null;
        }
    }
}
